# Maintainer: Johannes Löthberg <johannes@kyriasis.com>

pkgname=python-srcinfo
pkgver=0.1.2
_tag=4bf4f83bb5242ae932c54197dd63047f487f0d1c
pkgrel=1

pkgdesc="Simple .SRCINFO parsing library"
url='https://github.com/kyrias/python-srcinfo'
arch=(any)
license=(ISC)

depends=(python python-parse)
makedepends=(git python-build python-installer python-poetry-core python-wheel)

source=("git+https://github.com/kyrias/python-srcinfo?signed#tag=$_tag")

validpgpkeys=(5134EF9EAF65F95B6BB1608E50FB9B273A9D0BB5)
sha256sums=(SKIP)

build() {
	cd python-srcinfo
	python -m build --wheel --no-isolation
}

check() {
	cd python-srcinfo
	python -m unittest discover -v
}

package() {
	cd python-srcinfo
	python -m installer --destdir="$pkgdir" dist/*.whl
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
}
